<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="description" content="Serverless Koa.js 应用" />
  <meta name="keywords" content="koa,koa.js,serverless,无服务" />
  <title>Serverless - Koa.js</title>
  <!-- Import style -->
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/element-plus/dist/index.css" />
  <!-- Import Vue 3 -->
  <script src="//cdn.jsdelivr.net/npm/vue@next"></script>
  <!-- Import component library -->
  <script src="//cdn.jsdelivr.net/npm/element-plus"></script>
  <style lang="css">
    h1 {
      text-align: center;
      width: 600px;
      margin: 100px auto;
    }
  </style>
</head>

<body>
  <h1>
    欢迎访问 feiyu127的 Koa.js 应用
  </h1>
  <div>
    本应用提供如下接口
    <div id="app">
      <div>
        <span>生成1x1 px的gif图像的base64数据</span>
        <a target="_blank" :href="miniGIFUrl">{{ miniGIFUrl }}</a>
        <input type="color" name="color" id="color" v-model="selectedColor">
        <span>{{ selectedColor }}</span>
      </div>
      <div>
        <span>生成一个随机的身份证</span>
        <a target="_blank" :href="idGenerateUrl">{{idGenerateUrl}}</a>
      </div>
    </div>



  </div>
  <script>
    let app = Vue.createApp({
      data() {
        return {
          selectedColor: '#000000',
          idGenerateUrl: '/api/idNumber/generate'
        }
      },
      methods: {
        changeColor(that) {
          selectedColor.innerText = that.value;
        }
      },
      computed: {
        miniGIFUrl() {
          return `/api/image/miniGIF?color=` + this.selectedColor.replace('#', '');
        }
      }
    });
    app.use(ElementPlus);
    app.mount('#app')


  </script>
</body>

</html>